*The following file contains major code strings used for models estimation. The code does not include commands for basic data screening/cleaing. 

clear
*change directory, use own directory!
cd "C:\Users\Data file for final version"

*change for correct path!
use "C:\Users\Data file for final version\JMS_2023_data file_final.dta" 



*for collapsing unnecessary dummies
*ssc install reghdfe

*setting the time series
xtset ID YEAR

*Main model analysis

*model with 2-way interactions (with NACE and gov't owenrship)
*directly sanctioned firms
*turnover, short and long term
xtreg LN_TURNOVER DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & DIRSANCTFILTER == 1, fe vce(robust)
xtreg LN_TURNOVER DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if DIRSANCTFILTER == 1, fe vce(robust)

*employees, short and long term
xtreg LN_EMPLOYEES DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & DIRSANCTFILTER == 1, fe vce(robust)
xtreg LN_EMPLOYEES DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if DIRSANCTFILTER == 1, fe vce(robust)

*subsidiaries of sanctioned parents
*turnover, short and long term
xtreg LN_TURNOVER SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & SUBSANCTDFILTER == 1, fe vce(robust)
xtreg LN_TURNOVER SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if SUBSANCTDFILTER == 1, fe vce(robust)

*employees short and long term
xtreg LN_EMPLOYEES SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & SUBSANCTDFILTER == 1, fe vce(robust)
xtreg LN_EMPLOYEES SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if SUBSANCTDFILTER == 1, fe vce(robust)


*Robust regression (used in robustness check)
*installation for robust regression (if not installed)

ssc install xtrobreg
ssc install robreg
ssc install moremata

*model with 2-way interactions (with NACE and gov't owenrship)
*directly sanctioned firms
*turnover, short and long term
xtrobreg mm LN_TURNOVER DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & DIRSANCTFILTER == 1, fe vce(robust)
xtrobreg mm LN_TURNOVER DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if DIRSANCTFILTER == 1, fe vce(robust)

*employees, short and long term
xtrobreg mm LN_EMPLOYEES DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & DIRSANCTFILTER == 1, fe vce(robust)
xtrobreg mm LN_EMPLOYEES DIRSANCTD##UOGOV DIRSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if DIRSANCTFILTER == 1, fe vce(robust)

*subsidiaries of sanctioned parents
*turnover, short and long term
xtrobreg mm LN_TURNOVER SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & SUBSANCTDFILTER == 1, fe vce(robust)
xtrobreg mm LN_TURNOVER SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if SUBSANCTDFILTER == 1, fe vce(robust)

*employees short and long term
xtrobreg mm LN_EMPLOYEES SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if YEAR <2017 & SUBSANCTDFILTER == 1, fe vce(robust)
xtrobreg mm LN_EMPLOYEES SUBSANCTD##UOGOV SUBSANCTD##NACE_SEC LN_ASSETS GDPGROWTHLAG LNGDPREALLAG  if SUBSANCTDFILTER == 1, fe vce(robust)




